<?php

Route::group(['middleware' => 'rabc.role:SupAdmin, Admin, Admin_other'], function() {
      //后台网站设置编辑
      Route::get('systembase', 'Admin\Systembase@index')
            ->name('system.index');


      Route::post('systemupdate', 'Admin\Systembase@update')
          ->name('system.update')
          ->middleware('rabc.node:AdminSystem_update');

});

//对后台用户进行增删改查
Route::group(['middleware' => 'rabc.role:SupAdmin'], function(){

      Route::get('adminuser', 'Admin\AdminUser@index')
          ->name('AdminUser.index')
          ->middleware('rabc.node:AdminUser_list');

      Route::get('adminusercreate', 'Admin\AdminUser@create')
          ->name('AdminUser.create')
          ->middleware('rabc.node:AdminUser_create');

      Route::post('adminuserstore', 'Admin\AdminUser@store')
          ->name('AdminUser.store');

      Route::get('adminuseredit/{id}', 'Admin\AdminUser@edit')
          ->name('AdminUser.edit')
          ->middleware('rabc.node:AdminUser_edit');

      Route::post('adminuserupdate/{id}', 'Admin\AdminUser@update')->name('AdminUser.update');

      Route::get('adminusershow/{id}', 'Admin\AdminUser@show')
          ->name('AdminUser.show')
          ->middleware('rabc.node:AdminUser_show');

      Route::get('adminuserchange/{id}', 'Admin\AdminUser@change')
          ->name('AdminUser.change')
          ->middleware('rabc.node:AdminUser_change');

      Route::post('adminuserchange/{id}', 'Admin\AdminUser@doChange')->name('AdminUser.doChange');

      Route::get('adminuserstop', 'Admin\AdminUser@stop')
          ->name('AdminUser.stop')
          ->middleware('rabc.node:AdminUser_stop');

      Route::get('adminuserstart', 'Admin\AdminUser@start')
          ->name('AdminUser.start')
          ->middleware('rabc.node:AdminUser_start');

      Route::get('adminuserdestroy', 'Admin\AdminUser@destroy')
          ->name('AdminUser.destroy')
          ->middleware('rabc.node:AdminUser.delete');
//
});
//
Route::group(['middleware' => 'rabc.role:SupAdmin'], function() {
      //对后台角色的增删改查
      Route::get('adminrole', 'Admin\AdminRole@index')
          ->name('AdminRole.index')
          ->middleware('rabc.node:AdminRole_list');

      Route::get('adminrolecreate', 'Admin\AdminRole@create')
          ->name('AdminRole.create')
          ->middleware('rabc.node:AdminRole_create');

      Route::get('adminroleedit/{id}', 'Admin\AdminRole@edit')
          ->name('AdminRole.edit')
          ->middleware('rabc.node:AdminRole_edit');

      Route::post('adminroleupdate/{id}', 'Admin\AdminRole@update')->name('AdminRole.update');

      Route::post('adminrolestore', 'Admin\AdminRole@store')->name('AdminRole.store');

      Route::get('adminroleshow/{id}', 'Admin\AdminRole@show')
          ->name('AdminRole.show')
          ->middleware('rabc.node:AdminRole_show');

      Route::get('adminroledestroy', 'Admin\AdminRole@destroy')
          ->name('AdminRole.destroy')
          ->middleware('rabc.node:AdminRole_delete');
});

Route::group(['middleware' => 'rabc.role:SupAdmin'], function() {
      //对后台权限节点的增删改查
      Route::get('adminnode', 'Admin\AdminNode@index')
          ->name('AdminNode.index')
          ->middleware('rabc.node:AdminNode_list');

      Route::get('adminnodecreate', 'Admin\AdminNode@create')
          ->name('AdminNode.create')
          ->middleware('rabc.node:AdminNode_create');

      Route::post('adminnodestore', 'Admin\AdminNode@store')->name('AdminNode.store');

      Route::get('adminnodedit/{id}', 'Admin\AdminNode@edit')
          ->name('AdminNode.edit')
          ->middleware('rabc.node:AdminNode_edit');

      Route::post('adminnodeupdate/{id}', 'Admin\AdminNode@update')->name('AdminNode.update');

      Route::get('adminnodedestroy', 'Admin\AdminNode@destroy')
          ->name('AdminNode.destroy')
          ->middleware('rabc.node:AdminNode_delete');
});

Route::group(['middleware' => 'rabc.role:SupAdmin, Admin, Admin_goods, Admin_other'], function() {
      //对后台轮播图的增删改查
      Route::get('adminloop', 'Admin\AdminLoop@index')
          ->name('AdminLoop.index')
          ->middleware('rabc.node:AdminLoop_list');

      Route::get('adminloopcreate', 'Admin\AdminLoop@create')
          ->name('AdminLoop.create')
          ->middleware('rabc.node:AdminLoop_create');

      Route::post('adminloopstore', 'Admin\AdminLoop@store')->name('AdminLoop.store');

      Route::get('adminloopstop', 'Admin\AdminLoop@stop')
          ->name('AdminLoop.stop')
          ->middleware('rabc.node:AdminLoop_stop');

      Route::get('adminloopstart', 'Admin\AdminLoop@start')
          ->name('AdminLoop.start')
          ->middleware('rabc.node:AdminLoop_start');

      Route::get('adminloopedit/{id}', 'Admin\AdminLoop@edit')
          ->name('AdminLoop.edit')
          ->middleware('rabc.node:AdminLoop_edit');

      Route::post('adminloopupdate/{id}', 'Admin\AdminLoop@update')->name('AdminLoop.update');

      Route::get('adminloopdelete', 'Admin\AdminLoop@destroy')
          ->name('AdminLoop.destroy')
          ->middleware('rabc.node:AdminLoop_delete');
});
